package com.web.webth.mq; /**
 * Created with IDEA
 * author:HanLiBin
 * Date:2018/3/1
 * Time:9:33
 * version 1.0
 */

import lombok.Data;
import org.springframework.jms.core.MessageCreator;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import java.io.Serializable;

/**
 * @author HanLiBin
 * @version V1.0
 */
@Data
public class BaseMsg implements MessageCreator {
    private Serializable msg;
    @Override
    public Message createMessage(Session session) throws JMSException {
        return session.createObjectMessage(msg);
    }

    public BaseMsg(Serializable msg) {
        this.msg = msg;
    }

    public BaseMsg() {
    }
}
